<template>
  <div>
    <section class="section-2 relative">
      <p class="header">MEMBER INQUIRY<span>会员查询</span></p>
      <div class="flex-justycontent-center">
        <a-input  v-model="keyword" placeholder="搜索" autocomplete="off" />
        <a-button  type="primary" class="t-serch" @click="search">查询</a-button>
      </div>
      <p class="ml5 mt60">查询结果:</p>
      <div class="rules-item">
        <a-table  @change="handleTableChange" :pagination="pagination" :columns="columns" :data-source="list" :row-key="record => record.id">
        </a-table>
        <!-- <div class="mod flex-space-between" v-for="(item, index) in list" :key="index" @click="toDetail(item)">
          <div class="mod-left">
            <span class="circel"></span>
            <span class="title">{{item.title}}</span>
          </div>
          <div class="mod-right">
            <a  @click.stop="down(item.realPath)" class="down">下载</a>
            <span class="time">{{item.time}}</span>
          </div>
        </div> -->
      </div>
    </section>
  </div>
</template>
<script>
export default {
  name: 'association',
  data () {
    return {
      list: [],
      pagination: {
        total: 0,
        pageSize: 15,
        current: 1
      },
      pageNo: 1,
      pageSize: 15,
      columns: [{
        title: '序号',
        dataIndex: 'order_sn',
        key: 'order_sn',
        scopedSlots: { customRender: 'order_sn' }
      }, {
        title: '性质',
        dataIndex: 'nature',
        key: 'nature',
        scopedSlots: { customRender: 'nature' }
      }, {
        title: '会员单位',
        dataIndex: 'name',
        key: 'name',
        scopedSlots: { customRender: 'name' }
      }, {
        title: '联络员',
        dataIndex: 'link_man',
        key: 'link_man',
        scopedSlots: { customRender: 'link_man' }
      }, {
        title: '地址',
        dataIndex: 'address',
        key: 'address',
        scopedSlots: { customRender: 'address' }
      }],
      keyword: '',
      form: this.$form.createForm(this)
    }
  },
  components: {
  },
  computed: {
  },
  created () {
    this.getArticles()
  },
  methods: {
    getArticles () {
      this.$http.dwsearch({
        searchKey: this.keyword,
        pageNo: this.pagination.current,
        pageSize: this.pagination.pageSize
      }).then(res => {
        // res.data.list.forEach(v => {
        //   v.realPath = `${process.env.VUE_APP_SRC}${v.realPath}`
        // })
        this.pagination.total = res.data.total
        this.list = res.data.list
      })
    },
    search () {
      this.pagination.current = 1
      this.getArticles()
    },
    handleTableChange (pagination) {
      this.pagination.current = pagination.current
      this.getArticles()
    },
    toDetail (item) {
      this.$router.push({ path: `/fold/${item.id}` })
    },
    down (url) {
      if (url) {
        window.location.href = url
      }
    }
  }
}
</script>
<style lang="scss">
</style>
